<%@page contentType="text/html; charset=UTF-8" session="false" %>
<%@include  file="/WEB-INF/jspf/import.jspf"%>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" id="pagerForm" name="searchForm" method="get">
        <input type="hidden" name="pageNum" value="${pageNum}" />
        <div class="searchBar">
            <table class="searchContent">
                <tbody>
                    <tr>
                        <td><label>车友会名称：</label><input type="text" name="clubName" value="${clubName}" class="textInput"></td>
                        <td><label>车友会ID：</label><input type="text" name="clubId" <c:if test="${clubId > 0}">value="${clubId}"</c:if> class="textInput"></td>
                        <td><label>日志时间：</label>
                            <input type="text" name="start" id="start" datefmt="yyyy-MM-dd 00:00:00" value="${start}" class="date" readonly="true">
                            至
                            <input type="text" name="end" id="end" datefmt="yyyy-MM-dd 23:59:59" value="${end}" class="date" readonly="true">
                        </td>
                        <td style="color:red"><c:if test="${!empty msg }">${msg }</c:if></td>
                    </tr>
                    <tr>
                        <td><label>用户名：</label><input type="text" name="username" value="${username}" class="textInput"></td>
                        <td><label> 积分类型：</label>
                              <select id="reason" name="reason">
                                    <option value="0">全部</option>
                                    <c:forEach items="${reasons}" var="r">
                                        <option value="${r.name}" <c:if test="${reason == r.name}">selected</c:if>>${r.name}</option>
                                    </c:forEach>
                                </select>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="subBar">
                <ul>
                    <!--<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="exportFile();">导出</button></div></div></li>-->
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="pageContent">
    <table class="table" style="width: 100%" layoutH="136">
        <thead>
            <tr>
                <th >车友会ID</th>
                <th >车友会名称</th>
                <th >个性域名</th>
                <th >用户名</th>
                <th >油值</th>
                <th >积分类型</th>
                <th >时间</th>
            </tr>
        </thead>
        <tbody>
            <c:forEach var="e" items="${list}">
                <tr>
                    <td>${e.club.clubId}</td>
                    <td>${fn:escapeXml(e.club.name)}</td>
                    <td>${fn:escapeXml(e.club.clubUrl)}</td>
                    <td>${fn:escapeXml(e.user.username)}</td>
                    <td>${e.petrol}</td>
                    <td>${fn:escapeXml(e.reason) }</td>
                    <td><fmt:formatDate value="${e.createAt}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                </tr>
            </c:forEach>
        </tbody>
    </table>
</div>
<div class="panelBar">
    <div class="pages">
        <span>共 ${total} 条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="${total}" numPerPage="${pageSize}" pageNumShown="10" currentPage="${pageNum}"></div>
</div>
<script>
        var clubName="${param.clubName}";
        var clubId="${param.clubId}";
        var start = "${param.start}";
        var end = "${param.end}";
        var username = "${param.username}";
        var reason = "${param.reason}";
        function exportFile(){
            location.href="${ROOT}/admin/petrol/petrolLogBatchExport.do?clubName="+clubName+"&clubId="+clubId+"&start="+start+"&end="+end+"&username="+username+"&reason="+reason;
        }
</script>